package com.cy.pj.notice.web.config拦截器配置;

import com.cy.pj.notice.web.interceptor拦截器.TimeAccessInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration //表明这个类是配置类
public class SpringWebConfig implements WebMvcConfigurer {
   TimeAccessInterceptor a=new TimeAccessInterceptor();
    /**
     * 注册拦截器
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(a)
                .addPathPatterns("/not/*");//设置要拦截的路径--url
    }
}
